package com.senthink.gl.business.domain.repository;

import com.senthink.gl.business.forgetpw.VerifyCode;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

/**
 * 校验码持久化接口
 * @author yuanpeng@senthink.com
 * @data 2018-02-28 10:58
 */
public interface VerifyCodeRepository extends JpaRepository<VerifyCode, Long>{

    /**
     * 获取校验码对象容器
     * @param account
     * @return
     */
    Optional<VerifyCode> findTopByAccount(String account);

    /**
     * 删除验证码
     * @param account
     */
    void deleteByAccount(String account);
}
